home *** CD-ROM | disk | FTP | other *** search
- vs.1.0
- // Decl(Position, v0)
- // Decl(PointSize, v4) (Sprite radius)
- // Decl(Diffuse, v5)
- // Load(VisualPrCamera, c0, c3)
- // Load(SpriteScaleVect, c4, c4) = [tan(FovY/2)/ViewportHeight]*VisualToCamera.Column[Z]
- // Load(Time, c5, c5)
-
- ;------------------------------------------------------------------------------
- ; Vertex transformation + color
- ;------------------------------------------------------------------------------
- ; Transform position to projection space
- m4x4 oPos, v0, c0
- ; just copy the diffuse
- mov oD0, v5
-
- ;------------------------------------------------------------------------------
- ; PointSize compute
- ;------------------------------------------------------------------------------
- ; Transform position to camera space => Get only z, & then scale by tan(FovY/2)/ViewportHeight
- dp4 r1.x, v0, cSpriteScaleVect0
- rcp r1.x, r1.x ; Get the reciproque
- mul oPts.x, r1.x, vPointSize.x ; Scale by vertex's point size